import time

import mss
import mss.tools

# 屏幕坐标
x = 955
# x = 1758
y = 1139

time.sleep(2)
with mss.mss() as sct:
    # 截取单个像素
    monitor = {"top": y, "left": x, "width": 1, "height": 1}
    screenshot = sct.grab(monitor)

    # 获取 RGB 值（screenshot.pixel(0,0) 也可以，但直接取像素更可靠）
    b, g, r = screenshot.raw[0], screenshot.raw[1], screenshot.raw[2]
    print(f"坐标 ({x}, {y}) 的 RGB 值为: ({r}, {g}, {b})")